use TeO, clear

// Standardize outcomes
foreach x in feelfbpl feelfrench feelmorefor seenasfrench homeinfrance {
	qui sum `x'
	local `x'm=r(mean)
	sum `x' 
	local sd=r(sd)
	gen `x'st=(`x'-``x'm')/`sd'  
}

// religiosity
// standardize items 
foreach x in relimp r_ostent r_miam r_impedu r_culte {
	sum `x', det
	gen `x'_st=(`x'-r(mean))/r(sd)
}

egen avg_rel=rowmean(relimp_st r_ostent_st r_miam_st r_impedu_st r_culte_st)


//DID
local sample if bpl=="1101" &female==1  
local inter interm 
local controls i.birthyear i.religion tmuslim  
estimates clear

reg seenasfrenchst `controls' `inter' `sample'&fbpl!=1101  &mbpl!=1101, cl(religion)
eststo m3

reg homeinfrancest `controls' `inter' `sample'&fbpl!=1101  &mbpl!=1101, cl(religion)
eststo m4

reg feelfrenchst `controls' `inter' `sample'&fbpl!=1101  &mbpl!=1101, cl(religion)
eststo m5

reg feelfbplst `controls' `inter' `sample'&fbpl!=1101  &mbpl!=1101, cl(religion)
eststo m6

reg avg_rel `controls' `inter' `sample', cl(religion)
eststo m8

esttab m* using "TableA1.csv", star(+ 0.1 * 0.05 ** 0.01 *** 0.001) replace ///
		cells(b(fmt(a3) star) se(par)) stats(N r2)  ///
		keep(interm) 

